package com.iespring.mapper.admin;

import com.iespring.bean.admin.sys.bo.SysRolePageBo;
import com.iespring.bean.admin.sys.po.SysAdminPo;
import com.iespring.bean.admin.sys.po.SysPermissionPo;
import com.iespring.bean.admin.sys.po.SysRolePo;
import com.iespring.bean.admin.sys.po.SysStoragePo;
import com.iespring.bean.admin.sys.vo.SysPermissionModuleVo;
import com.iespring.bean.admin.sys.vo.SysPermissionVo;
import com.iespring.bean.admin.sys.vo.SysStoragePageVo;
import com.iespring.bean.admin.user.entity.MallLog;
import com.iespring.bean.common.BasePageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysMapper {
    List<SysRolePo> selectSysRoleOption();

    List<SysAdminPo> selectAdminsByAdmin(@Param("admin") SysAdminPo admin);

    List<SysAdminPo> selectAdmins(@Param("adminBo") BasePageInfo basePageInfo);

    //List<SysAdminPo> selectAdminsByName(@Param("adminBo") SysAdminByNameBo adminBo);

    int insertAdmin(@Param("admin") SysAdminPo sysAdminPo);

    int insertStorage(@Param("storage") SysStoragePo storage);


    int updateAdmin(@Param("admin") SysAdminPo sysAdminPo);

    List<SysRolePo> selectSysRoleOptionPage(@Param("pageInfo") SysRolePageBo basePageInfo);

    int insertRole(@Param("role") SysRolePo rolePo);

    int updateRole(@Param("role") SysRolePo role);

    //选择授权所需要的所有权限
    List<SysPermissionModuleVo> selectDeatilPermission();

    //选择单个角色权限
    List<String> selectRolePermission(Integer id);

    //选择admin的权限，也就是所有权限
    List<String> selectStart();

    Integer updateRolePermission(@Param("permission") List<SysPermissionPo> rolePermissionList);

    List<String> selectRolePermissionDeleted(Integer id);

    int insertRolePermission(@Param("role") List<SysPermissionPo> insertPos);

    List<SysRolePo> selectRoleByName(String name);

    List<SysStoragePo> selectStoragePage(@Param("pageInfo") SysStoragePageVo basePageInfo);

    int updateStorage(@Param("storage") SysStoragePo storagePo);

    SysStoragePo selectStorageByKey(String key);

    String selectDetailLabel(String permission);

    List<MallLog> selectLogPage(@Param("pageInfo") BasePageInfo pageInfo);
}
